<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form method="post">
    {% csrf_token %}
    <p>名字<input type="text" name="name" value="{{ data_goods.name }}"> </p>
    <p>价格<input type="text" name="price" value="{{ data_goods.price }}"> </p>
    <p>数量<input type="text" name="number" value="{{ data_goods.number }}"> </p>

        <p>
            <select name="brand">
                {% for i in brand_data %}
                    {% if i.id == data_goods.brand.id %}
                        <option value="{{ i.id }}" selected>{{ i.name }}</option>

                    {% else %}
                        <option value="{{ i.id }}">{{ i.name }}</option>
                    {% endif %}
                {% endfor %}
            </select>
        </p>
    <input type="submit" value="提交">
</form>

</body>
</html>